import request from '../request';
let api = {
  orderPreset: "/api/home/order/preset", //订单预览，结算时预览
  orderCreate: "/api/home/order/create", //订单创建
  orderCreateNl: '/api/home/order/unregistered-create', //订单创建,不需要登陆
  orderClose: "/api/home/order/close", //订单关闭
  orderList: "/api/home/order/list", //查询我的订单
  orderInfo: "/api/home/order/info", //查询我的订单详情
  orderTopay: "/api/home/order/to-pay", //订单支付跳转第三方
  orderPaycallback: "/api/home/order/pay-callback", //第三方支付回调
  orderConfirm: "/api/home/order/confirm", //确认收货
  orderComment: "/api/home/order/comment", //订单评价
  orderPay: "/api/home/order/pay", //支付订单
}
export default {
  //订单预览，结算时预览
  orderPreset(params = {}) {
    return request.post(api.orderPreset,
      params
    );
  },
  //订单创建
  orderCreate(params = {}) {
    return request.post(api.orderCreate,
      params
    );
  },
  //订单创建,不需要登陆
  orderCreateNl(params = {}) {
    return request.post(api.orderCreateNl,
      params
    );
  },
  //订单关闭
  orderClose(params = {}) {
    return request.post(api.orderClose,
      params
    );
  },
  //查询我的订单
  orderList(params = {}) {
    return request.get(api.orderList, {
      params
    });
  },
  //查询我的订单详情
  orderInfo(params = {}) {
    return request.get(api.orderInfo, {
      params
    });
  },
  //订单支付跳转第三方
  orderTopay(params = {}) {
    return request.post(api.orderTopay,
      params
    );
  },
  //第三方支付回调
  orderPaycallback(params = {}) {
    return request.post(api.orderPaycallback,
      params
    );
  },
  //确认收货
  orderConfirm(params = {}) {
    return request.post(api.orderConfirm,
      params
    );
  },
  //订单评价
  orderComment(params = {}) {
    return request.post(api.orderComment,
      params
    );
  },
  //立即支付订单
  orderPay(params = {}) {
    return request.post(api.orderPay,
      params
    );
  },
}
